* Deference  Study
*No Right to be Wrong: What Americans Think About Civil-Military Relations

* Use NoRightToBeWrong.dta here

log using "NoRightToBeWrong.txt", replace

***********************************************************************
******************************** RESULTS ******************************
***********************************************************************

*Table 1: Deference to the Military Table
tab DI1
tab DI2
tab DI3

*Figure 2: Active-Duty and Retired Military Officers and Policy Advocacy
tab boundaries3 // Active-Duty
tab boundaries8 // Retired

*Table 2: Deference to the military: Partisan Comparisons
tab DI2 pid2, column nofreq
tab DI1 pid2, column nofreq

*Table 3: Deference to the military: Trump Supporter Comparisons
tab DI2 DJT, column nofreq
tab DI1 DJT, column nofreq

*Figure 3: Deference Index Partisanship/Trump Approval
tab deferenceindex DJT, column
tab deferenceindex pid2, column

*Figure 4: Deference Index OLogit
ologit deferenceindex ideo7 DJT selfserv household trust miltherm hawk education ///
income female nonwhite polkno rwa bp civdef
est store m1
coefplot m1, scheme(s1mono) mlcolor(black) mfcolor(none) mcolor(black) ///
		xline(0, lpattern(dash) lcolor(red%50)) ///
		drop(_cons) mlabposition(6) mlabel ///
		aspect(1) xlab(-2 "Less Deference"  0  2 "More Deference")
		
*Figure 5: Binary deference index - Predicted Probabilities 


logit binarydeferenceindex i.DJTunst
margins i.DJTunst
marginsplot

logit binarydeferenceindex i.pid6
margins i.pid6
marginsplot

*Table 4

tab schakepre pid4
tab schakepre pid4, column

* Use Schake.dta here
use "/Users/robertralston/Downloads/schake.dta", replace
svyset [pw = weight]
tab pid7, nolabel
drop if pid7==8
svy: tab pid7 if statements3 != 8

svy: tab statements3 pid3, column 	
log close
		
